﻿<Window x:Class="VideoRenderExample.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:MediaBridge="clr-namespace:MediaBridge;assembly=VideoRendererElement"
        Title="Window1"
        Height="1024"
        Width="768"
        Loaded="Window_Loaded"
        Background="Black"
        Unloaded="Window_Unloaded">
    <Grid>
        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal">
            <Button Content="GDI Test"
                    x:Name="GDITest" />
            <Button Content="M-JPEG Test"
                    x:Name="MJPGTest" />
            <Button Content="Webcam Test"
                    x:Name="WebcamTest" />
        </StackPanel>
        
        <Viewbox  Margin="20, 20, 20, 20">
            
        
        <StackPanel>

            <MediaBridge:VideoRendererElement x:Name="videoRenderer" Width="320" Height="240" />
            <Border Width="320"
                    Height="240"
                    Opacity="0.4"
                    BorderBrush="White"
                    BorderThickness="0">
                <Border.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0"
                                         EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Offset="0"
                                          Color="Black" />
                            <GradientStop Offset=".6"
                                          Color="Transparent" />
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Border.OpacityMask>
                <Border.Background>
                    <VisualBrush Visual="{Binding ElementName=videoRenderer}">
                        <VisualBrush.Transform>
                            <ScaleTransform ScaleX="1"
                                            ScaleY="-1"
                                            CenterX="160"
                                            CenterY="120" />
                        </VisualBrush.Transform>
                    </VisualBrush>
                </Border.Background>
            </Border>

             </StackPanel> 
        </Viewbox>
    </Grid>
</Window>
